#include<stdio.h>
int main()
{
    int N,K,i;
    int arr[N];
    int br = 0;
    scanf("%d %d",&N,&K);
    for(i=0;i<=N;i++)
    {
        scanf("%d",arr[i]);
        if((arr[i]>K) && (arr[i]%3==0))
    {
        br++;
    }
        printf("%d",br);
    }

    return 0;
}
